let a = 10;
let b = 20;
let add = (a, b) => a + b;
console.log('add函数输出：', add(a, b));

for (let i = 0; i < 5; i++) {
    setImmediate(() => {
        console.log(i, 'loop log!');
    });
}

class Person {
    constructor(name, sex) {
        this.name = name;
        this.sex = sex;
    }
    sayName() {
        console.log(this.name);
    }
    saySex() {
        console.log(this.sex);
    }
}

let tim = new Person('tim', 'male');
tim.sayName();
tim.saySex();